package org.sunnyleaf.votedemo.client;

import java.util.List;

import org.sunnyleaf.votedemo.client.data.LoginResponse;
import org.sunnyleaf.votedemo.client.data.NewVoteRequest;
import org.sunnyleaf.votedemo.client.data.VoteRecord;

import com.google.gwt.user.client.rpc.AsyncCallback;
import org.sunnyleaf.votedemo.client.data.*;

/**
 * The async counterpart of <code>GreetingService</code>.
 */
public interface GreetingServiceAsync {	
	void greetServer(String input, AsyncCallback<String> callback);
	void checkLogin(AsyncCallback<LoginResponse> callback);
	void addNewVote(NewVoteRequest nvr, AsyncCallback<Vote> callback);
	void getVotesOwnsTo(String owner, AsyncCallback<List<Vote>> callback );
	void getVotesAttendedBy( String user, AsyncCallback<List<Vote>> callback );
	void getVoteRecords( Long voteId, AsyncCallback<List<VoteRecord>> callback );
	void getVoteItems( Long voteId, AsyncCallback<List<VoteItem>> callback );
	void getVoteByID( Long id, AsyncCallback<Vote> callback );
	void deleteVoteByID( Long id, AsyncCallback<String> callback );
//	void saveObj( Object obj, AsyncCallback<String> callback );	 
//  In order to produce smaller client-side code, 'Object' is not allowed; consider using a more specific type
	
	void saveVote( Vote vote, AsyncCallback<String> callback );
	void getVoteRecord( Long voteId, String account, AsyncCallback<VoteRecord> callback );
	void getVoteItemByID( Long id, AsyncCallback<VoteItem> callback );
	void saveVoteRecord(VoteRecord record, AsyncCallback<String> callback);
}
